<div id="content">
    <div class="row s_page_title">
        <sa-big-breadcrumbs [items]="['系统基础管理','用户类型']" icon="fa fa-list" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
    </div>
    <sa-widgets-grid>
        <div class="s_table">
            <div sa-widget [editbutton]="false" color="darken" class="clearfix">
                <header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
                    <h2>用户类型</h2>
                </header>
                <div>
                    <div class="widget-body no-padding">
                        <div class="page-header clearfix s_table_opreation">
                            <div class="left page-header-btn">
                                <button type="button" class="btn btn-primary" (click)="newUserType(userTypeModal)">添加</button>
                            </div>
                            <div class="right top-search">
                                <input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="用户类型名称...">
                                <span class="top-search-box">
                                    <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
                                </span>
                            </div>
                        </div>
                        <div class="table_scroll">
                            <table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                                <thead>
                                    <tr>
                                        <th>用户类型编号</th>
                                        <th>用户类型</th>
                                        <th>创建时间</th>
                                        <th>更新时间</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr *ngFor="let row of tableData">
                                        <td>{{row.userType}}</td>
                                        <td>{{row.userTypeName}}</td>
                                        <td>{{row.createTime}}</td>
                                        <td>{{row.updateTime}}</td>
                                        <td>
                                            <button type="button" (click)="editUserType(row,userTypeModal)">编辑</button>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="table-fix clearfix">
                            <paginator [totalRecords]="totalCount" [rows]="pageSize" [currentPage]="curPage - 1" (onPageChange)="paginate($event)">
                            </paginator>
                            <button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </sa-widgets-grid>
</div>

<!-- 新增编辑用户类型   弹窗-->
<section bsModal #userTypeModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" (click)="userTypeClose(userTypeModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title"><span *ngIf="formType == 'new'">新增</span><span *ngIf="formType == 'update'">编辑</span>用户类型</h4>
            </div>
            <form id="userTypeForm" class="form-horizontal" role="form" novalidate="novalidate" [saBootstrapValidator]="validatorOptions">
                <div class="modal-body">
                    <div class="row form-horizontal">
                        <div class="form-group col-xs-12">
                            <label class="control-label col-sm-3 no-padding-right">用户类型编码<sup>*</sup></label>
                            <div class="col-sm-9">
                                <input class="form-control" type="number" [disabled]="formType == 'update'"  id="userType" name="userType" [(ngModel)]="userTypeForm.userType" placeholder="用户类型编码" />
                            </div>
                        </div>
                        <div class="form-group col-xs-12">
                            <label class="control-label col-sm-3 no-padding-right">用户类型名称<sup>*</sup></label>
                            <div class="col-sm-9">
                                <input class="form-control" type="text" name='userTypeName' id="userTypeName" [(ngModel)]='userTypeForm.userTypeName'  placeholder="用户类型名称" >
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" (click)="userTypeClose(userTypeModal)">取消</button>
                    <button type="button" class="btn btn-primary" (click)="userTypeSubmit(userTypeModal)">确认</button>
                </div>
            </form>
        </div>
    </div>
</section>
<!-- 新增编辑用户类型 弹窗end-->